#include <stdio.h>

#include <pthread.h>


void * do_thread(void *arg)
{
    static int retval = 1000;
    pthread_exit((void *) &retval);
    printf("child thread start\n");
}
int main(int argc, char const *argv[])
{

    void * pret = NULL;
    pthread_t tid;
    int ret = pthread_create(&tid , NULL, do_thread, NULL);
    pthread_join(tid, &pret);

    //print
    printf("retval = %d\n", *(int *)pret);
    return 0;
}
